package com.jye.rseven.user.mapper;

        import com.jye.rseven.domain.Task;
        import org.apache.ibatis.annotations.Mapper;
        import org.apache.ibatis.annotations.Param;


        import java.util.List;

@Mapper
public interface TaskMapper {

    Task findTaskById(@Param("id") int id);

    void addTask(@Param("task") Task task);

    void updateTask(@Param("task") Task task);

    void deleteTaskById(@Param("id")int id);

    List<Task> findAllTaskByType(@Param("type")int type ,@Param("skip") int skip, @Param("limit") int limit);

    Task findTaskByCreateTimeAndType(@Param("createTime") String createTime, @Param("uId") Integer uId,@Param("type")Integer type);

    List<Task> findMyTaskByUIdAndType(@Param("uId")int uId,@Param("type")int type);

    List<Task> findAllTasksByPIdAndType(@Param("pId")int pId, @Param("type")int type, @Param("skip")int skip, @Param("limit")int limit);

    List<Task> findTasksByPIdAndType(@Param("pId")int pId, @Param("type")int type, @Param("skip")int skip, @Param("limit")int limit);

    int isVote(@Param("pId")int pId, @Param("uId")int uId);

    Integer findTaskVoteCountById(@Param("id")int id);

    void addVote(@Param("pId")int pId, @Param("uId")int uId);

    Task findTaskByUIdAndPId(@Param("uId") int uId,@Param("pId") int pId,@Param("type") int type);


}
